import React, { Component } from 'react'

export default class Table extends Component {
  render () {
    return (
      <div>
        <table>
          <tr>
            <th>Date</th>
            <th>Name</th>
            <th>Address</th>
            <th>Tag</th>
          </tr>
          {this.props.dataSource.map(item => {
            return (
              <tr key={item.date}>
                <td>{item.date}</td>
                <td>{item.name}</td>
                <td>{item.address}</td>
                <td>{this.props.render(item)}</td>
              </tr>
            )
          })}
        </table>
      </div>
    )
  }
}
